Linux下查看网卡信息及确定网卡位置以及更改网卡名称

您所在的位置:网站首页 linux 显示网络设备 Linux下查看网卡信息及确定网卡位置以及更改网卡名称

Linux下查看网卡信息及确定网卡位置以及更改网卡名称

2023-10-13 03:54| 来源: 网络整理| 查看: 265

转载链接 : Linux下查看网卡信息及确定网卡位置 https://blog.51cto.com/liuqun/1981915

查看Linux网卡访问流量的方法

安装iftop命令(基于epel源)

[root@node ~]#yum install -y iftop [root@node ~]#iftop -i eth0 #查看某个IP的访问流量的大小,进入后可按T键观察IP的总流量大小 [root@node ~]#iptables -I INPUT -p tcp -s 192.168.8.81 --dport 80 -j DROP #将访问流量大的IP进行封禁 [root@node ~]#iptables -I INPUT -p tcp -s 192.168.8.81 --dport 443 -j DROP [root@node ~]#iptables -vnL Chain INPUT (policy ACCEPT 6 packets, 428 bytes) pkts bytes target prot opt in out source destination 0 0 DROP tcp -- * * 192.168.8.81 0.0.0.0/0 tcp dpt:443 0 0 DROP tcp -- * * 192.168.8.81 0.0.0.0/0 tcp dpt:80 [root@node ~]#iptables-save > /etc/sysconfig/iptables [root@node ~]#vim /etc/rc.local iptables-restore address}=="00:50:56:29:0e:ae", ATTR{type}=="1" ,KERNEL=="eth*",NAME="eth0"

执行grub2-mkconfig -o /boot/grub2/grub.cfg命令生成更新grub配置参数

[root@Jaking11 rules.d]# grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.10.0-957.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-957.el7.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-fe49b659ccb940fa8d260a5897c0b08a Found initrd image: /boot/initramfs-0-rescue-fe49b659ccb940fa8d260a5897c0b08a.img done

重启Linux系统后验证网卡名称是否更改成功

[root@Jaking11 ~]# ifconfig eth0: flags=4163mtu 1500 inet 192.168.10.11 netmask 255.255.255.0 broadcast 192.168.10.255 inet6 fe80::250:56ff:fe29:eae prefixlen 64 scopeid 0x20 ether 00:50:56:29:0e:ae txqueuelen 1000 (Ethernet) RX packets 86 bytes 10889 (10.6 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 95 bytes 10828 (10.5 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

总 结

以上就是更改 RHEL7 或者 CentOS 7 的网卡名称的方法,最后看到 eth0 说明网卡名称更改成功!

参考链接 :

教你更改 RHEL7 或者 CentOS 7 的网卡名称 :https://mp.weixin.qq.com/s/JEOwT3T3ROUOuAC9pDaO-Q

Linux下查看网卡信息及确定网卡位置 https://blog.51cto.com/liuqun/1981915

Linux学习笔记(八)网络管理 :https://www.jianshu.com/p/9a141eea2047

查看Linux网卡访问流量的方法 https://blog.51cto.com/14163901/2451900



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3